package com.ktvme.core;

import cn.hutool.json.JSONArray;
import cn.hutool.json.JSONObject;

import java.util.List;

public abstract class AbstractFlinkJobService implements FlinkJobService{
    protected final String baseUrl;

    protected AbstractFlinkJobService(String baseUrl) {
        this.baseUrl = baseUrl;
    }


    public abstract String runJar(String jarId, RunJarRequest request);

    protected abstract List<JobInfo> parseJobList(JSONArray jobsArray, String state);

    protected abstract JobInfo parseJobInfo(JSONObject json);

    protected abstract JarInfo parseJarUploadResponse(JSONObject json);

    protected abstract JSONObject buildRunParameters(RunJarRequest request);
}
